package com.mysen.sso.conf;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.mysen.sso.util.SFTPClient;

@ConfigurationProperties
@Configuration
public class SFtpConfiguration {
	
	@Value("${spring.sftp.host}")
    private String host;
	@Value("${spring.sftp.port}")
    private int port = 22;
	@Value("${spring.sftp.username}")
    private String username;
	@Value("${spring.sftp.password}")
    private String password;
	@Value("${spring.sftp.ftppath}")
    private String ftppath;

	@Bean
	public SFTPClient sftpClientFactory() {
		SFTPClient client = new SFTPClient(host,port,username,password, ftppath);
		return client;
	}
	
}
